package com.yxlcommon.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yxlcommon.common.pojo.WorksInfo;

import java.util.List;

/**
 * @author: yxl
 * @since: 2021-11-26
 **/

public interface WorksInfoMapper extends BaseMapper<WorksInfo> {

    List selectNewWorksInfo();

    List selectHotWorksInfo();

    List<WorksInfo> selectHotWorksInfoByCategoryId(Integer cid);

    List<WorksInfo> selectNewWorksInfoByCategoryId(Integer cid);

    List<WorksInfo> selectWorksInfoByUser(Integer userId);

    List<WorksInfo> selectWorksInfoByUsername(String username);

    IPage<WorksInfo> selectWorksInfoByKeyword(Page<WorksInfo> worksInfoPage, String workName);

    WorksInfo selectWorkByWorkId(Long workId);

    List<WorksInfo> selectWorkByKeyword(String keyword,String type);

    List<WorksInfo> selectWorksInfoByCategory(Integer categoryId, String type);

    List<WorksInfo> selectAllWorks();

    void updateWorkLikesNum(long objId, long likesNum);

    Integer selectCountWorkLikes(Long objId);

//    WorksInfo selectComments(Integer workId);

//    List<WorksInfo> selectUserByWorksInfo();
}
